<html xmlns="http://www.w3.org/1999/xhtml"><head><style type="text/css">
dt {
  font-style: italic;
  margin-top: 15px;
  margin-bottom: 3px;
  margin-left: 0px;
  border-bottom: 1px dotted black;
}
dd {
  margin-left: 10px;
}
table {
  border-collapse:collapse;
  border: 1px solid black;
  margin-top: 7px;
}
th {
  border: 1px solid black;
  padding: 3 7 3 7;
}
td {
  border: 1px solid black;
  padding: 3 7 3 7;
}
</style></head><body><p><a name="baload"></a><b>baload</b> :
  retrieve byte/boolean from array : <a href="opcodes.html">index</a> : <a href="http://asm.objectweb.org/asm40/javadoc/user/org/objectweb/asm/MethodVisitor.html#visitInsn(int)">visitInsn()</a></p><dl><dt>Description</dt><dd>Retrieves a byte from a byte array, expands it to an integer and places
it on the operand stack. <i xmlns="">arrayref</i> is a reference to an array of bytes.
<i xmlns="">index</i> is an int. The <i xmlns="">arrayref</i> and <i xmlns="">index</i> are removed from
the stack, and the 8-bit signed byte at the given <i xmlns="">index</i> in the array is
retrieved, sign-extended to a 32-bit int, and pushed onto the stack.<br></br>baload is also used to retrieve values from boolean arrays. In this case,
<i xmlns="">arrayref</i> is a reference to an array of booleans (see the
newarray instruction) . If the entry at the given <i xmlns="">index</i> is
true, then the int 1 is pushed onto the stack, otherwise the int 0 is
pushed onto the stack. In Sun's implementation, boolean arrays are actually
stored as byte arrays, using one byte per boolean value. Other implementations
might use packed arrays - or even int arrays - this is invisible to programs
running on the JVM, which always use baload and bastore to access and store
values in boolean arrays.</dd><dt>Example</dt><dd><pre>
; This is like the Java code:
;     byte x = arr[0];
; where x is local variable 2 and arr is a byte array in local variable 1
aload_1       ; load local variable 1 onto the stack
iconst_0      ; push the integer 0 onto the stack
baload        ; retrieve the entry
istore_2      ; store the entry in local variable 2
</pre>
<b xmlns="">
Exceptions</b><br></br>NullPointerException - <i xmlns="">arrayref</i> is null<br></br>ArrayIndexOutOfBoundsException - <i xmlns="">index</i> is &lt; 0 or &gt;=
arrayref.length</dd><dt>See also</dt><dd><a href="ref-iaload.html">iaload</a> <a href="ref-.html"></a> <a href="ref-laload.html">laload</a> <a href="ref-.html"></a> <a href="ref-faload.html">faload</a> <a href="ref-.html"></a> <a href="ref-daload.html">daload</a> <a href="ref-.html"></a> <a href="ref-aaload.html">aaload</a> <a href="ref-.html"></a> <a href="ref-caload.html">caload</a> <a href="ref-.html"></a> <a href="ref-saload.html">saload</a> <a href="ref-.html"></a> <a href="ref-iastore.html">iastore</a> <a href="ref-.html"></a> <a href="ref-lastore.html">lastore</a> <a href="ref-.html"></a> <a href="ref-fastore.html">fastore</a> <a href="ref-.html"></a> <a href="ref-dastore.html">dastore</a> <a href="ref-.html"></a> <a href="ref-aastore.html">aastore</a> <a href="ref-.html"></a> <a href="ref-bastore.html">bastore</a> <a href="ref-.html"></a> <a href="ref-castore.html">castore</a> <a href="ref-.html"></a> <a href="ref-sastore.html">sastore</a> <a href="ref-.html"></a> <a href="ref-newarray.html">newarray</a> </dd><dt>Stack</dt><dd><table xmlns="">
<tr>
<td>
<b>Before </b>
</td>
<td><b>After</b></td></tr>
<tr>
<td>index</td>
<td>value</td></tr>
<tr>
<td>arrayref</td>
<td>...</td></tr>
<tr>
<td>...</td>
<td>...</td></tr>
</table></dd><dt>Bytecode</dt><dd><table xmlns="">
<tr>
<td>
<b> Type </b>
</td>
<td><b>Description</b></td></tr>
<tr>
<td>
u1 
</td>
<td>baload
opcode = 0x33 (51)
</td></tr>
</table></dd></dl></body></html>